This notebook gives an introduction and overview of the codebase/API involved in the thesis project titled: "High Performance Computing for Evaluating Volume Massing Designs". The codebase is intended to work as a standalone API executable so the reasoning behind this jupyter notebook is to provide a transparent overview of the APIs capabilities. The codebase is supplemented by a thesis report with litterature study and a walkthrough of the engines used in the codebase. Examples of thesis report ready text can be found here:
Week 4 report ready text: https://1drv.ms/b/s!ArT2Rk1rI-5viIZ8DYLSjZLuU3-yng?e=SwQXpJ
Week 5 report ready text: https://1drv.ms/b/s!ArT2Rk1rI-5viIkdBSnb9n6r9rLXmg?e=ZmfKBs
The main goal of the API is to serve as a tool for conducting volume massing design studies. A volume massing design study is an architectural process of defining the polygon boundaries of a new building within an existing building context, based on building performance simulations. The structure of the API is originally inspired by: https://pure.au.dk/portal/da/publications/building-performance-simulation-supporting-typical-design-activities-the-case-of-volume-massing(1b3a413f-bf5d-4b28-94ab-6e287939f4d9).html
The general structure of the API is as follows:
One of the main innovations from this API compared to previous work and other related software packages is the use of GPU based raytracing. Furthermore the API will work out of the box and not require any detailed knowledge about the underlying engines (the API makes justifiable assumptions for you). The API will be CAD agnostic working as an independant executable. Lastly several "experimental" approaches for speeding up computation time is implemented as laid out by the version overview/roadmap below.
Several building performance simulation engines are called by the API. They have been selected as industry standard and have all been validated against physical real world measurements and/or are based on relevant industry standards.
https://www.radiance-online.org/
https://nljones.github.io/Accelerad/
Modelled after Radiance
Very fast simulation engine for early stage design energy simulation. Based on ISO 13790.
Extensive simulation engine, with possibilities for modelling with a high level of detail.
This is a development roadmap of the API versions. The reasoning behind developing the API with multiple versions is to be able to narrate the changes in implementation and their effect on speed and accuracy.
Implementation of the conventional approach to volume massing design. The daylight analysis and radiation analysis is based on Radiance. The energy analysis is based on EnergyPlus. That is - all computations are CPU based.
This implementation will serve as a benchmarking baseline in terms of speed for the other versions. Also this implementation will serve a as basis for comparing results.
Same as baseline implementation except changing Radiance function calls (CPU based raytracing) to Accelerad function calls (GPU based raytracing).
Same as version 0.0.1 except: Relying on database of .smx. Reusing ambient calcuation between radiation and daylight simulation. Computing in one channel, instaed of 3 color channels.
Same as version 0.0.2 except: Implementing ICEbear instead of EnergyPlus.
Same as version 0.0.3 except: Keeping output from Accelerad rfluxmtx in GPU memory instead of writing it to stdout (as is the way rfluxmtx is implemented). Performing GPU based matrix multiplikation.
This is a walkthrough of the steps involved for conducting a radiation analysis using the baseline version (all of the below functions calls can be run by simply calling recipes.radiationanalysis as well).
First step is to recieve a geometry input in .rad (radiance) format from a frontend. Alternatively the input geometry can be defined in a text editor. The input geometry is subdived into: volume massing facades (the vertical surfaces of the design), the rest of the volume massing and the context (surrounding buildings). There is also an example folder included in the API with examples.
from display.visualization import load_rad_to_plotly
import plotly.graph_objects as go
INPUT_GEO_FILES = ["examples\\example1\\volume_massing.rad",
"examples\\example1\\volume_massing_rest.rad",
"examples\\example1\\context.rad"]
data = load_rad_to_plotly(INPUT_GEO_FILES)
fig = go.Figure(data=data)
fig.show()
Some additional input i required from the user/front end as follows:
#User inputs
import os
RADIANCE_PATH = r"C:\Radiance"
ACCELERAD_PATH = r"C:\Accelerad"
SIMULATION_FOLDER = r"C:\baseline_test" #Needs to be without whitespace
LOCATION = "Copenhagen"
RESOLUTION = "1"
#Other inputs
MAIN_PATH = os.path.abspath('')
Based on these inputs a object containing all relevant path definitions is createad:
#Managing paths to database files etc. in panda
from general.paths import path_manager
path_mananger_pd = path_manager(RADIANCE_PATH,ACCELERAD_PATH,
SIMULATION_FOLDER, LOCATION,
MAIN_PATH,RESOLUTION,
INPUT_GEO_FILES)
Next step in the radiation analysis is to convert the epw file data (direct normal radiation and diffuse horizontal radiation) to a Tregenza discretized Perez all-weather sky model for all 8760 hours in the year:
from externalcommands.radiancecommands import run_epw2wea, run_gendaymtx, run_rfluxmtx_radiation, run_dctimestep, run_rmtxop
#epw2wea
run_epw2wea(path_mananger_pd)
START - Subprocess: C:\Radiance\bin\epw2wea DONE - Subprocess: C:\Radiance\bin\epw2wea. Returncode: 0
#wea2smx (Perez sky model with Tregenza subdivision)
run_gendaymtx(path_mananger_pd,spektrum = "full spektrum", resolution = 1)
START - Subprocess: C:\Radiance\bin\gendaymtx DONE - Subprocess: C:\Radiance\bin\gendaymtx. Returncode: 0 START - Writing ASCII data DONE - Writing ASCII data
Then it is needed to create virtual sensorpoints and corresponding meshes to color based on the result on the facades of the volume massing:
from geometry.radiationgrid import gen_pts_and_sub_mesh
out = gen_pts_and_sub_mesh(path_mananger_pd,
x_dim = 2,
y_dim = 2,
offset = 0.01)
no_of_sensor_points_total = out[6]
from display.visualization import load_radiation_mesh_to_plotly
data = load_radiation_mesh_to_plotly(path_mananger_pd)
fig = go.Figure(data=data)
fig.show()
Next from each sensor-point, the daylight coefficients to the sky can be calculated:
run_rfluxmtx_radiation(path_mananger_pd,
no_of_sensor_points_total)
START - Subprocess: C:\Radiance\bin\rfluxmtx DONE - Subprocess: C:\Radiance\bin\rfluxmtx. Returncode: 0 START - Writing ASCII data DONE - Writing ASCII data
And Lastly dctimestep is used to perform the Matrix multiplication E = DC x S. And since Radiance computes in three channels rmtxop is used to compute the final result - radiation on the facades
run_dctimestep(path_mananger_pd,
simulation_type = "RADIATION_ANALYSIS")
START - Subprocess: C:\Radiance\bin\dctimestep DONE - Subprocess: C:\Radiance\bin\dctimestep. Returncode: 0 START - Writing ASCII data DONE - Writing ASCII data
run_rmtxop(path_mananger_pd,
simulation_type = "RADIATION_ANALYSIS")
START - Subprocess: C:\Radiance\bin\rmtxop DONE - Subprocess: C:\Radiance\bin\rmtxop. Returncode: 0 START - Writing ASCII data DONE - Writing ASCII data